<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>浮动</title>
    <style>
        .c1 {
            width: 150px;
            height: 150px;
            background-color: red;
            float: left;
        }

        .c2 {
            width: 250px;
            height: 250px;
            background-color: yellow;
            float: left;
        }

        .c3 {
            width: 350px;
            height: 350px;
            background-color: blue;
            float: left;
        }

        .c4 {
            width: 450px;
            height: 450px;
            background-color: pink;

            /* 清除左右两边浮动 - 技巧 */
            clear: both;
        }
    </style>

</head>

<body>
    <div class="c1"></div>
    <div class="c2"></div>
    <div class="c3"></div>
    <div class="c4"></div>
</body>

</html>